class WikiImage < WikiAsset
 
#  image_column :file, 
#               :versions => {:thumb => "75x75", :small => "300x400"},
#               :store_dir => proc{|wiki_asset| "wiki_assets/#{wiki_asset.id}/"},
#               :tmp_dir => proc{|wiki_asset| "wiki_assets/tmp/"}
               
  before_save :get_image_dimensions
  
 private
  # NOTE: this will only work bc already using RMagick. Should be part of upload column
  def get_image_dimensions
    img = ::Magick::Image.read(self.file.path).first
    self.file_width = img.columns
    self.file_height = img.rows
  end
end
